//
//  ViewController.m
//  IOS运行时
//
//  Created by song on 15/9/8.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "ViewController.h"
#import  <objc/objc-runtime.h>
#import <objc/runtime.h>
#import <objc/message.h>
#import "EmptyClass.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    class_addMethod([EmptyClass class], @selector(sayHello), (IMP)sayHello, "v@:");
    EmptyClass *ins =[[EmptyClass alloc] init];
//    [ins sayHello];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

void sayHello(id self , SEL _cmd)
{
    NSLog(@"hello word!");
}


@end
